include(CommonModularInterface)
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS} ${RUBY_NARRAY_INCLUDE_DIR})

GENERATE_MODULAR_TARGET(ruby ${CMAKE_CURRENT_SOURCE_DIR} ${RUBY_LIBRARY})
set_target_properties(ruby_modular PROPERTIES PREFIX "")

SET(RUBY_MODULAR_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitearchdir']"
		OUTPUT_VARIABLE RUBY_SITE_ARCH_DIR
		ERROR_QUIET)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/modshogun.so
	DESTINATION ${RUBY_SITE_ARCH_DIR}
	COMPONENT ruby
	RENAME modshogun${EXT_LIB_SWIG_RUBY_MODULAR})

set(CPACK_COMPONENT_RUBY_DISPLAY_NAME "Ruby interface" PARENT_SCOPE)
set(CPACK_COMPONENT_RUBY_DESCRIPTION "Ruby modular interface of Shogun" PARENT_SCOPE)
set(CPACK_COMPONENT_RUBY_GROUP "Runtime" PARENT_SCOPE)
set(CPACK_COMPONENT_RUBY_DEPENDS libraries PARENT_SCOPE)
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ruby PARENT_SCOPE)
